bug fix to beg2char