removed tostring to attempt to fix encoding issue
changed to utf-8 in write to client