modified addagent.php