handle exit codes