fix iOS 6 compatibility