Fix autocomplete
sorting function for grid