fix osx darwin bug