fixes restarting in ruby 2.x by moving the restart outside the trap