fix throwing error in response to code review