adding logic to save searches