Finish game function fix