Removed the huge memory leak. Added timer.