diff --git a/GeoLib/Grid.h b/GeoLib/Grid.h
index 67201783113db566131f01b73b5d53babc94c4a7..b0b9eb5e408e4a7f79db3dbf156d49f81a1d410a 100644
--- a/GeoLib/Grid.h
+++ b/GeoLib/Grid.h
@@ -137,7 +137,7 @@ public:
 				std::cout << "error computing indices " << std::endl;
 			}
 
-			_grid_cell_nodes_map[i + j * _n_steps[0] + k * n_plane].push_back(copyOrAddress(*it));
+			_grid_cell_nodes_map[i + j * _n_steps[0] + k * n_plane].push_back(const_cast<POINT*>(copyOrAddress(*it)));
 			it++;
 		}
 
@@ -328,6 +328,7 @@ private:
 	}
 
 	static POINT* copyOrAddress(POINT& p) { return &p; }
+	static POINT const* copyOrAddress(POINT const& p) { return &p; }
 	static POINT* copyOrAddress(POINT* p) { return p; }
 
 	double _step_sizes[3];