new method for processing packet.