Added compatibility for osx

Added compatibility for osx