Error catching in agent.py
Changed configdir parameter to config folder path instead of config file path