added fix in match_tirs subroutine