Fixed issue #178

$agent_query should be initialized with NULL instead of '' empty string so that isset() will return FALSE if $agent_query is not set.