monkeypatching quit and exit - fixes issue #3