added support for macosx quit