fixed misnamed var. res => packet