added null check on bytes for all packets