Osx support

support for portability with osx