fix build issues on mac