added multibyte support