added autosearch functionality