solve the model foreign key problem