fixed bugs causing lessons to duplicate