fixed invalid size of handle to alloc