Error while opening next lesson.

In the variable creates three ways to know the last unit, initialize and easy way