Improve to handle OS X