changes to get it working on mac