index error in edges of file