fix mislabelled foreign keys