change make_tbfile to remove getelementidbyposition function