Moving search logging statement inside if search_input