changing if statement for iOS8