Added a shutdown boolean to trigger an exception preventing restarts