wrapped possible encoding errors
some error handling