Changed agent variable to public so that sub-agents can access it