update exit_code in db