Make sure the exit code is set correctly