added error checking when greating graph - shouldn't crash anymore from filenotfound or fileinuse exceptions