check autocomplete result, and remove debug code