fix bug in update(), delete()