fix bugs for Collection.add and remove