fix bug of class from str and unicode