previously, you just had to encode it and check the length, which isn't ideal