added callbacks to add, replace and remove, some fixes