Added error for missing foreign key