change onPacket()