try to improve error handling of stack-collector-agent