Fix bug for osx