I'd favor setting this boolean outside of this function.