Sec. 6. ADVANCE BY STATE. Funds required to be tendered to an out-of-state witness pursuant to Article 24.28 of this Code shall be paid by the Comptroller of Public Accounts into the registry of the Court in which the case is to be tried upon certification by the Court such funds are necessary to obtain attendance of said witness. The court shall then cause to be issued checks drawn upon the registry of the Court to secure the attendance of such witness. In the event that such funds are not used pursuant to this Act, the Court shall return the funds to the Comptroller of Public Accounts.