add visited field to node