updated packet handler