modified size validator code