Fix creating record after adding foreign key feature