fixing incorrect out and in edge keys