changes to allow build on MacOS