updated to work on osx