added iOS 6 support