add length sanity check to custom attribute example