Added function to return a correct packet size