Added creating new node logic