still fixing foreign key issues