Fixed issues related to UTF-8 encoding and validity checking
Added rescue clause, to avoid crashing the server!