Fix bug on autocomplete behavior