corrects errors on database