diff --git a/amd/src/studyplan-editor-components.js b/amd/src/studyplan-editor-components.js
index 372c893..f0015ac 100644
--- a/amd/src/studyplan-editor-components.js
+++ b/amd/src/studyplan-editor-components.js
@@ -1362,7 +1362,8 @@ export default {
:slotindex="index"
:line="line"
:plan="value"
- :class= "'t-studyline ' + (line.sequence==1?' first':'') + (line.sequence==numlines?' last':'')"
+ :class= "'t-studyline ' + (line.sequence==1?' first':'') +
+ (line.sequence==value.studylines.length?' last':'')"
>