Issues/ios6 compatiblity

Compatibility for iOS6