Add new callback, onCollectionAddCallback

* Added a callback to handle actions after an element was added to the collection.
* Remove unused global variable