Lecture page memory leak fix

Lecture page memory went upto 110MB. Fix reduces it to 50MB. Page is
smoother, and faster.