made autocomplete more robust