fix a bug for Collection.remove