Adding graceful exit catches