fixed printout bug