wow  that is pretty terrible  i find it hard to believe that this was in here all these years thankfully  i just copied the from somewhere else  so i only need to be half deathly ashamed about this  please refactor this out into an extra patch since it is a generic fix  not directly related to mt 