added scoring system. but crashes when game ends