added rotation support for iOS 5