fixed bugged that crashed the game when changing between levels