debugging the basic agent code for errors