fix Type Error when delete a collection