fixing Foreign keys