Fix crash, when the screen turns off