fixed error with encoding