Fixed code for Xcode 6 beta 5