fixed error detection in update