Added some improvemens to foreign key