Fixed graph to not allow duplicate nodes