solve bug in output