diff --git a/apps/benchmarks/GranularGas/GenerateModule.py b/apps/benchmarks/GranularGas/GenerateModule.py
index a6b7696b1337ff87da5bea5f5ffccca155e00d09..573be3b4273e0885b35e5d6e39db2e6d4864c004 100755
--- a/apps/benchmarks/GranularGas/GenerateModule.py
+++ b/apps/benchmarks/GranularGas/GenerateModule.py
@@ -50,7 +50,7 @@ if __name__ == '__main__':
    ps.addProperty("nextParticle",     "int",                     defValue="-1",        syncMode="NEVER")
 
    ps.addInclude("blockforest/BlockForest.h")
-   ps.addProperty("currentBlock",     "blockforest::Block*",     defValue="nullptr",   syncMode="NEVER")
+   ps.addProperty("currentBlock",     "blockforest::BlockID",    defValue="",          syncMode="NEVER")
 
    kernels = []
    kernels.append( kernel.DoubleCast(shapes) )
diff --git a/python/mesa_pd.py b/python/mesa_pd.py
index 0ba17be6b76d5f60c39471b924b2fe6c95411471..57a8f138210daf92b7d18997adf739780d9c8b90 100755
--- a/python/mesa_pd.py
+++ b/python/mesa_pd.py
@@ -49,7 +49,7 @@ if __name__ == '__main__':
    ps.addProperty("oldTorque",        "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="MIGRATION")
 
    ps.addInclude("blockforest/BlockForest.h")
-   ps.addProperty("currentBlock",     "blockforest::Block*",     defValue="nullptr",   syncMode="NEVER")
+   ps.addProperty("currentBlock",     "blockforest::BlockID",    defValue="",          syncMode="NEVER")
 
    ps.addProperty("type",             "uint_t",                  defValue="0",         syncMode="COPY")
 
diff --git a/src/mesa_pd/data/ParticleAccessor.h b/src/mesa_pd/data/ParticleAccessor.h
index e1a9b17c721491afee2135f955f205598683f311..f71f39af2a0fa421d4965f3ec0e5f14f0d07ebfd 100644
--- a/src/mesa_pd/data/ParticleAccessor.h
+++ b/src/mesa_pd/data/ParticleAccessor.h
@@ -108,9 +108,9 @@ public:
    walberla::mesa_pd::Vec3& getOldTorqueRef(const size_t p_idx) {return ps_->getOldTorqueRef(p_idx);}
    void setOldTorque(const size_t p_idx, walberla::mesa_pd::Vec3 const & v) { ps_->setOldTorque(p_idx, v);}
    
-   blockforest::Block* const & getCurrentBlock(const size_t p_idx) const {return ps_->getCurrentBlock(p_idx);}
-   blockforest::Block*& getCurrentBlockRef(const size_t p_idx) {return ps_->getCurrentBlockRef(p_idx);}
-   void setCurrentBlock(const size_t p_idx, blockforest::Block* const & v) { ps_->setCurrentBlock(p_idx, v);}
+   blockforest::BlockID const & getCurrentBlock(const size_t p_idx) const {return ps_->getCurrentBlock(p_idx);}
+   blockforest::BlockID& getCurrentBlockRef(const size_t p_idx) {return ps_->getCurrentBlockRef(p_idx);}
+   void setCurrentBlock(const size_t p_idx, blockforest::BlockID const & v) { ps_->setCurrentBlock(p_idx, v);}
    
    uint_t const & getType(const size_t p_idx) const {return ps_->getType(p_idx);}
    uint_t& getTypeRef(const size_t p_idx) {return ps_->getTypeRef(p_idx);}
@@ -253,9 +253,9 @@ public:
    void setOldTorque(const size_t /*p_idx*/, walberla::mesa_pd::Vec3 const & v) { oldTorque_ = v;}
    walberla::mesa_pd::Vec3& getOldTorqueRef(const size_t /*p_idx*/) {return oldTorque_;}
    
-   blockforest::Block* const & getCurrentBlock(const size_t /*p_idx*/) const {return currentBlock_;}
-   void setCurrentBlock(const size_t /*p_idx*/, blockforest::Block* const & v) { currentBlock_ = v;}
-   blockforest::Block*& getCurrentBlockRef(const size_t /*p_idx*/) {return currentBlock_;}
+   blockforest::BlockID const & getCurrentBlock(const size_t /*p_idx*/) const {return currentBlock_;}
+   void setCurrentBlock(const size_t /*p_idx*/, blockforest::BlockID const & v) { currentBlock_ = v;}
+   blockforest::BlockID& getCurrentBlockRef(const size_t /*p_idx*/) {return currentBlock_;}
    
    uint_t const & getType(const size_t /*p_idx*/) const {return type_;}
    void setType(const size_t /*p_idx*/, uint_t const & v) { type_ = v;}
@@ -319,7 +319,7 @@ private:
    walberla::mesa_pd::Vec3 force_;
    walberla::mesa_pd::Vec3 oldForce_;
    walberla::mesa_pd::Vec3 oldTorque_;
-   blockforest::Block* currentBlock_;
+   blockforest::BlockID currentBlock_;
    uint_t type_;
    int nextParticle_;
    std::map<walberla::id_t, walberla::mesa_pd::data::ContactHistory> oldContactHistory_;
diff --git a/src/mesa_pd/data/ParticleStorage.h b/src/mesa_pd/data/ParticleStorage.h
index 0837b343210818b13a9ec1509d707ee555988447..7ff16c341846c3169f16fdcee9a75b96a704b7fc 100644
--- a/src/mesa_pd/data/ParticleStorage.h
+++ b/src/mesa_pd/data/ParticleStorage.h
@@ -86,7 +86,7 @@ public:
       using force_type = walberla::mesa_pd::Vec3;
       using oldForce_type = walberla::mesa_pd::Vec3;
       using oldTorque_type = walberla::mesa_pd::Vec3;
-      using currentBlock_type = blockforest::Block*;
+      using currentBlock_type = blockforest::BlockID;
       using type_type = uint_t;
       using nextParticle_type = int;
       using oldContactHistory_type = std::map<walberla::id_t, walberla::mesa_pd::data::ContactHistory>;
@@ -273,7 +273,7 @@ public:
    using force_type = walberla::mesa_pd::Vec3;
    using oldForce_type = walberla::mesa_pd::Vec3;
    using oldTorque_type = walberla::mesa_pd::Vec3;
-   using currentBlock_type = blockforest::Block*;
+   using currentBlock_type = blockforest::BlockID;
    using type_type = uint_t;
    using nextParticle_type = int;
    using oldContactHistory_type = std::map<walberla::id_t, walberla::mesa_pd::data::ContactHistory>;
@@ -722,7 +722,7 @@ inline ParticleStorage::iterator ParticleStorage::create(const id_t& uid)
    force_.emplace_back(real_t(0));
    oldForce_.emplace_back(real_t(0));
    oldTorque_.emplace_back(real_t(0));
-   currentBlock_.emplace_back(nullptr);
+   currentBlock_.emplace_back();
    type_.emplace_back(0);
    nextParticle_.emplace_back(-1);
    oldContactHistory_.emplace_back();
@@ -1214,10 +1214,10 @@ public:
 class SelectParticleCurrentBlock
 {
 public:
-   using return_type = blockforest::Block*;
-   blockforest::Block*& operator()(data::Particle& p) const {return p.getCurrentBlockRef();}
-   blockforest::Block*& operator()(data::Particle&& p) const {return p.getCurrentBlockRef();}
-   blockforest::Block* const & operator()(const data::Particle& p) const {return p.getCurrentBlock();}
+   using return_type = blockforest::BlockID;
+   blockforest::BlockID& operator()(data::Particle& p) const {return p.getCurrentBlockRef();}
+   blockforest::BlockID& operator()(data::Particle&& p) const {return p.getCurrentBlockRef();}
+   blockforest::BlockID const & operator()(const data::Particle& p) const {return p.getCurrentBlock();}
 };
 ///Predicate that selects a certain property from a Particle
 class SelectParticleType
diff --git a/src/mesa_pd/kernel/AssocToBlock.h b/src/mesa_pd/kernel/AssocToBlock.h
index 9936d57c6ca9b1f6b905ab657b6a59738c4bdb38..f25008abc8157e59da4c59d18cd28b02279ea26f 100644
--- a/src/mesa_pd/kernel/AssocToBlock.h
+++ b/src/mesa_pd/kernel/AssocToBlock.h
@@ -54,7 +54,7 @@ template <typename Accessor>
 inline void AssocToBlock::operator()(const size_t idx,
                                      Accessor& ac) const
 {
-   blockforest::Block*& currentBlock = ac.getCurrentBlockRef(idx);
+   blockforest::Block* currentBlock = bf_->getBlock(ac.getCurrentBlock(idx));
 
    if (currentBlock != nullptr)
    {
@@ -71,6 +71,7 @@ inline void AssocToBlock::operator()(const size_t idx,
    {
       if (blk.second->getAABB().contains(ac.getPosition(idx)))
       {
+         ac.setCurrentBlock(idx, blk.second->getId());
          currentBlock = blk.second.get();
          return;
       }
@@ -85,6 +86,8 @@ inline void AssocToBlock::operator()(const size_t idx,
       {
          WALBERLA_LOG_DEVEL(blk.second->getAABB());
       }
+      using namespace walberla::mesa_pd::data::particle_flags;
+      WALBERLA_LOG_DEVEL_VAR(isSet(ac.getFlags(idx), GHOST));
    }
    WALBERLA_CHECK_NOT_NULLPTR(currentBlock, ac.getPosition(idx));
 }
diff --git a/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.cpp b/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.cpp
index 08bfc37ef2fe59ac0e128809d0d0bbdcd9ccf5a7..c24bf8b75f97e31b6859da535f60dff66e4d0b16 100644
--- a/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.cpp
+++ b/src/mesa_pd/mpi/SyncNextNeighborsBlockForest.cpp
@@ -18,12 +18,6 @@
 //
 //======================================================================================================================
 
-//======================================================================================================================
-//
-//  THIS FILE IS GENERATED - PLEASE CHANGE THE TEMPLATE !!!
-//
-//======================================================================================================================
-
 #include "SyncNextNeighborsBlockForest.h"
 #include <mesa_pd/domain/BlockForestDomain.h>
 
@@ -122,8 +116,8 @@ void SyncNextNeighborsBlockForest::generateSynchronizationMessages(data::Particl
          continue;
       }
 
-      auto& currentBlock = pIt->getCurrentBlockRef();
-      WALBERLA_CHECK_NOT_NULLPTR(currentBlock);
+      auto currentBlock = bf->getBlock(pIt->getCurrentBlock());
+      WALBERLA_CHECK_NOT_NULLPTR(currentBlock, *pIt);
       if (isInsideAABB(pIt->getPosition(), pIt->getInteractionRadius() + dx, currentBlock->getAABB()))
       {
          //no sync needed