move check_familydefault to AtBeginDocument