added size verification