fixing out of memory error 2