Updated read function to handle packet data.