fix compile error on Xcode5 : casting problem