fix for helper method that was crashing in iOS 7.x