improved iOS 5 compatibility