[fix] autocomplete with multiple space at the end fixed