fixed memory usage