Fixed bugs

fixed bugs with score and endgame