modify to gurantee OSX compile OK