Yes, but the point was the "punishment" part is 21 years maximum. Any additional time will be only to protect the lives of other citizens.
Extending the prison term seems like the right way to go and keep the issues of punishment and safekeeping separate.
Don't know if you're from Norway, but Norwegian criminal law has a distinction between 21 years, which is the maximum sentence permitted by law, and "forvaring", which is explicitly defined as additional, indefinite custody with the express purpose of protecting society from violent criminals which have a very high risk of doing repeat offenses.