detect_chars output improvment