fix for memory usage