if else statement for search