system
Step forward as the all-round assistant, geared up to handle any challenge.
human
Identify and correct any inconsistent use of pronouns in the following passage.

Relevant data:
"After Sam made dinner for Sarah and himself, they sat down to eat. They both enjoyed the food, and he thanked her for helping."
gpt
After Sam made dinner for Sarah and himself, they sat down to eat. They both enjoyed the food, and Sam thanked Sarah for helping.