use allocate instead of alloc