fix not to output unneeded chars