updated eligibility checking section