foreign key issue resolved