Fixed packet capturing

fixes #639