fix the osx bugs