I can't recreate the problem with your code.
I would try using a "new" variable for the menu handle. I've had weird problems before when using static variables that made them "stick".
So your problem might be that iMenu is not always set with menu_create() and it will keep the old value which it will then call again.
At least that would explain the problem.