Updated for xcode6/ios8