replaced utf8_encode with mb_convert_encoding