fixing more memory usage