Add quit logic.