check of command length before serialization