Added the functions of agent