slight change to execute mac-only code only on mac (darwin)