fix bug with encoding string