added osx-only logic
patched with debug symbol and osx argument