Notwithstanding any provision of law to the contrary, any person who has a personal, mortgage, or mortgage chattel loan from the retirement system may upon retirement, if otherwise entitled, receive his retirement annuity, notwithstanding the fact that he may have an outstanding balance on such loan; Provided, That he agrees to have an amount equal to the amount deducted from his salary for repayment of the loan deducted from his retirement annuity and applied as payment to the outstanding balance of the loan.