Modified logic to determine if iOS 6.x or iOS 5.1.x is in use