moved the packet setup to the main process