Updated iOS 8 code