So they put away the foreign gods from among them and served the Lord, and he became impatient over the misery of Israel.