added  an if commando in the event that the search citeria is null to prevent the server from shutting down