Moved checkScreenRotation