added search query and ip logging