solve exception

fixed disconnected agent throw exception while adding counter