fixed a bug with c-agent