fixed game crash on lost focus