added validation to search