catch errors on update query