fixed the bug related to quitting the game

Signed-off-by: rubinrana <scaryrubin@hotmail.ca>