fixed rotation and screen off issues