fix bug when auto_complete is used outside of main page