handle update or delete