try/catch blocks to agent related stuff