diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30644507311cb4a969102c25db2c5fb9af620008..e438e4cb4542b2d8c0006c7c733341ba15143e73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -242,4 +242,4 @@ message(STATUS
         "   Compound Lib                   (-DCOMPOUND_LIB) : ${_COMP_LIB}\n"
         "   TMAlign and TMScore         (-DCOMPILE_TMTOOLS) : ${_TM_TOOLS}\n"
         "   Static Libraries              (-DENABLE_STATIC) : ${ENABLE_STATIC}\n"
-        "   Debian-style 'libexec' (-DDEBIAN_STYLE_LIBEXEC) : ${_DEBIAN_STYLE_LIBEXEC}")
\ No newline at end of file
+        "   Debian-style 'libexec' (-DDEBIAN_STYLE_LIBEXEC) : ${_DEBIAN_STYLE_LIBEXEC}")
diff --git a/modules/io/pymod/wrap_io.cc b/modules/io/pymod/wrap_io.cc
index 53ba11f7c85173c3ebc56c14002db8443e5c229f..bc10f6f6a32fc6c9e6c3031e5abd94031f367d2e 100644
--- a/modules/io/pymod/wrap_io.cc
+++ b/modules/io/pymod/wrap_io.cc
@@ -113,7 +113,6 @@ BOOST_PYTHON_MODULE(_ost_io)
   def("LoadCRD", &LoadCRD);
   def("LoadCHARMMTraj_", &LoadCHARMMTraj, (arg("ent"), arg("trj_filename"), 
       arg("stride")=1, arg("lazy_load")=false));
-
   def("LoadMAE", &LoadMAE);
 
   export_pdb_io();
diff --git a/modules/mol/base/src/chain_handle.cc b/modules/mol/base/src/chain_handle.cc
index 9ff209e3571e80fc5c653af540ce5027cabc6ff2..c1e745f2c2c4456fb765782d17caf13630d32d07 100644
--- a/modules/mol/base/src/chain_handle.cc
+++ b/modules/mol/base/src/chain_handle.cc
@@ -251,5 +251,11 @@ EntityView ChainHandle::Select(const String& q, QueryFlags flags) const {
   else return this->GetEntity().Select(Query("cname='"+Impl()->GetName()+"'"), flags);
 }
 
+void ChainHandle::SetInSequence(const int index)
+{
+  this->CheckValidity();    
+  Impl()->SetInSequence(index);
+}
+
 }}
 
diff --git a/modules/mol/base/src/chain_handle.hh b/modules/mol/base/src/chain_handle.hh
index 576c4b6715a6b0a796abe6e1b78fc4bd41da11d5..8f88c6e3757473acd558c0d0b830e56f46235a29 100644
--- a/modules/mol/base/src/chain_handle.hh
+++ b/modules/mol/base/src/chain_handle.hh
@@ -193,7 +193,9 @@ public:
   bool operator==(const ChainHandle& ref) const;
   bool operator!=(const ChainHandle& ref) const;
 
-
+  /// \brief checks whether res breaks the in sequence property
+  ///        and updates it accordingly
+  void SetInSequence(const int index);
 };
 
 }} // ns
diff --git a/modules/mol/base/src/editor_base.cc b/modules/mol/base/src/editor_base.cc
index 6757c2af674587f478e8c7e4d5fb63607b581b1e..e9fed6874cf52057b0ad21b82dc8fa3980bc3ba8 100644
--- a/modules/mol/base/src/editor_base.cc
+++ b/modules/mol/base/src/editor_base.cc
@@ -79,7 +79,9 @@ void EditorBase::RenameResidue(ResidueHandle res, const String& new_name)
 void EditorBase::SetResidueNumber(ResidueHandle res, const ResNum& new_num)
 {
   CheckHandleValidity(res);
+  int index=res.GetIndex();
   res.Impl()->SetNumber(new_num);
+  res.GetChain().SetInSequence(index);
 }
   
 void EditorBase::RenameChain(ChainHandle chain, const String& new_name)
diff --git a/modules/mol/base/src/impl/chain_impl.cc b/modules/mol/base/src/impl/chain_impl.cc
index 46026902068b5e6b978e76cdcbbfdff1499459c6..5ac2b91ab1d6cf372769d9135ecffd38a97773a1 100644
--- a/modules/mol/base/src/impl/chain_impl.cc
+++ b/modules/mol/base/src/impl/chain_impl.cc
@@ -484,4 +484,19 @@ void ChainImpl::ReorderResidues()
   UpdateShifts();
 }
 
+void ChainImpl::SetInSequence(const int index)
+{
+  ResNum num=residue_list_[index]->GetNumber();
+  //Check if rp is in sequence
+  if (in_sequence_) {
+    if (index>0 && residue_list_[index-1]->GetNumber()>=num)
+      in_sequence_=false;
+    if (index<static_cast<int>(residue_list_.size())-1 && residue_list_[index+1]->GetNumber()<=num)
+      in_sequence_=false;
+  }
+  if (in_sequence_) {
+    this->UpdateShifts();
+  }
+}
+  
 }}} // ns
diff --git a/modules/mol/base/src/impl/chain_impl.hh b/modules/mol/base/src/impl/chain_impl.hh
index 1f871d504768d260daac80b4e9239b98f76e95e6..8e99792dd1597eefe4a28658d46d2a6fd97fed87 100644
--- a/modules/mol/base/src/impl/chain_impl.hh
+++ b/modules/mol/base/src/impl/chain_impl.hh
@@ -175,7 +175,10 @@ public:
                                 const ResNum& start,
                                 const ResNum& end); 
   int GetIndexForResNum(const ResNum& number) const;
-  
+  ///\brief checks if the residue with that index breaks the in_sequence
+  ///       property and updates it accordingly      
+  void SetInSequence(int index);
+
 private:
   int GetIndexForResNumInSequence(const ResNum& number) const;
   void UpdateShifts();