fix bug when adding an object while the game is stopped