memory usage issues fixed