Add check in hook_entity_info_alter()