fix issue #597 autocomplete