end of lesson handling events