added size validation