Implement quit and stop