fix bug in client agent