do configuration check first, and defensively