connect function added to add the current node to the parent event dispatcher