fixed refreshAgent.sh