added iOS 5 support