tweaked a bit for iOS 7