added in code to initialize the agent