fixed error when item is deleted