Fixed crash when loosing focus (screen lock or application switch)