fixed encoding for error messages