Updating create packet function