fix printing bug