a bug when output to non-terminal fixed