checks on update, insert, and delete