added hooks for ending the game