Added compatibility with MAC OS X