updated to work marginally well in iOS 7