fixed code crashing when algorithm is remembered