fix char locate bug