fixed bug and some unicode issues