Fix crashing bug when running pre-iOS 8