updated for work with OSX