fixed compatibility with iOS 5