Added collection onAdd function