fix a bug in the print_text subroutine