moved initialization of autocomplete widget to separate function