Ensure correct types beforedoing searh