Fix for Foreign Key problem