if else statment for search accuracy