fix referential integrity