fix repeat chars problem