solve the memory problem