bugfix: the last char scan