fixed game delete bug. code refactoring