allocate correct size