Added check for foreign keys (as validation)