OSX support

Tested on mac application and it works great