add quit handler