Fixed bug on graph factory: it committed graph every time