Foreign key validation fixed