Solved autocomplete bug with a quite elegant hack