fix the bug in autocomplete search