updated agent code to work with config file
updated agent code