adding fixes for osx or non ubuntu OSs