fixed error with global agentID value and explicit block in CASE