fixed the length of character issue