Solved error whereby searchterm was being added regardless of no search input