fix self modifying code