trim search before searching