Change editNode to a closure