fix bug in table printing