fix bug in printout