fix immediate exit after open on osx