Fix the edgeList generation bug