use agent and send instead of def and def