Fixed memory leak for 2413
Made changes based on feedback