Fixed a bug where enemy spawn logic fails sometimes after returning to main menu and starting the game again.