fix graph creation