fix compile error on mac osx