fixed the memory problems - clear factors