fix gateway-mac to work on osx