fixed initialization issue on mac osx