fix bug on starting the agent daemons