update code to suit for Xcode 4.6 warning