added compatibilty of OS X