Added simple event handler for quitting.