Add exit code handler