added changes needed for running script on OSX