Updated 'length' validation