fix polymorphic foreign key error