added output encoding