read graph from file - bug fix