bugfix on create graph routine