fixing out of memory error 1