finished add node method