added osx auto-detection support