detect chars bug fix