working version of node connection