add exit code to shutdown