allocating caches overlapping memory problem fixed