fix bug in pretty printing