fix memory allocation for tiles and wpp