fix character sort issue