Stop level processing once leave() is called
Merge pull request #1917 from DaNiwa/state_switch

Stop level processing once leave() is called