Added compatibility for OSX