fix bug in prettyPrint