exits cleanly