If a member ceases to be a teacher or employee except by death or retirement, the member must be paid within six months after the member's demand for payment, but not less than ninety days after ceasing to be a teacher or employee, the sum of the member's contributions and the accumulated regular interest on the contributions.