Added support for iOS6 and iOS7