Added OSX specific code