Added validation for search