changes to make it work on osx