Fix error when trying to login under iOS 7