diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp
index 5c8497481fb9b2f47e437562081ba11c15385d52..d8ddbcc10bb78326f48fb8d16f8e1563a3725497 100644
--- a/source/Lib/DecoderLib/DecLib.cpp
+++ b/source/Lib/DecoderLib/DecLib.cpp
@@ -1958,9 +1958,6 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
     DTRACE_UPDATE( g_trace_ctx, std::make_pair( "final", 1 ) );
   }
 
-  // actual decoding starts here
-  xActivateParameterSets( nalu.m_nuhLayerId );
-
   //detect lost reference picture and insert copy of earlier frame.
   {
     int lostPoc;
@@ -2010,6 +2007,8 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
     xUpdateRasInit(m_apcSlicePilot);
   }
 
+  // actual decoding starts here
+  xActivateParameterSets( nalu.m_nuhLayerId );
 
 #if JVET_P0125_EOS_LAYER_SPECIFIC
   m_firstSliceInSequence[nalu.m_nuhLayerId] = false;