fixed issue with cookie not storing search term correctly