Fixed an issue with ComponentManager

Now components to add are cached to avoid concurrent modification.