Fixed game closing crash bug