solve issue of foreign key mapping