add agent and collector code