fixing a bug in adding attributes to collections