added locks on graphs and nodes
added locks to graphs and nodes