change MAX_LENGTH to be an object rather than a byte string