fixed a bug that resulted in wrong restarting of the game