added communication between master and agent