Added MacOS compatibility