writePacket error in derived classes