allow the code to work on iOS 6