fix undeclared variable error in Xcode 6