modify packet to allow self defined pattern