updated for OSX, fixed issue with openFile()