Fixed variable name issue in agent.