Foreign key check