fixed the foreign key not being set on application