Add global keyword for the exit_code variable