Updated for iOS 7 (orientation bug)