bugfix for output encoding