bugfix recv code undeclared vars