diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperListViewParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperListViewParameter.cxx
index 1266416b51e5bb4e73cd331584b0ca247cb9575e..b93660f4b862b052c1962eef75438f155e26b29e 100644
--- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperListViewParameter.cxx
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperListViewParameter.cxx
@@ -157,13 +157,12 @@ ListViewParameter::SetSelectedNames(std::vector<std::string> selectedNames)
   std::vector<int> selectedItems;
   std::vector<std::string> names = this->GetChoiceNames();
 
-
-  if(m_SingleSelection && m_SelectedNames.size() > 1)
+  if(m_SingleSelection && selectedNames.size() > 1)
     {
-    itkExceptionMacro(<<"Single selection mode is on, but there are "<<m_SelectedNames.size()<<" selected items");
+    itkExceptionMacro(<<"Single selection mode is on, but there are "<<selectedNames.size()<<" selected items");
     }
   
-  for(unsigned int i=0; i<m_SelectedNames.size(); i++)
+  for(unsigned int i=0; i<selectedNames.size(); i++)
     {
     const std::string selectedName = selectedNames[i];
     unsigned int j(0);