update has_lesson function