diff --git a/extraction/core/functions/cell.py b/extraction/core/functions/cell.py
index 13430d716080b8764815f00ee286f7dc0923c418..19f13940b80a8b1907eaf8d3d11e6f8fdc2398b8 100644
--- a/extraction/core/functions/cell.py
+++ b/extraction/core/functions/cell.py
@@ -55,7 +55,7 @@ def max5px_med(cell_mask, trap_image):
     max5px = np.mean(top_vals, dtype=float)
 
     med = sorted_vals[len(sorted_vals) // 2] if len(sorted_vals) else 1
-    return max5px / med
+    return max5px / med if med else max5px
 
 
 def max2p5pc_med(cell_mask, trap_image):
@@ -67,7 +67,7 @@ def max2p5pc_med(cell_mask, trap_image):
     max2p5pc = np.mean(top_vals, dtype=float)
 
     med = sorted_vals[len(sorted_vals) // 2] if len(sorted_vals) else 1
-    return max2p5pc / med
+    return max2p5pc / med if med else max2p5pc
 
 
 def std(cell_mask, trap_image):
diff --git a/poetry.lock b/poetry.lock
index 25a0e0434086c3a8b4322b42514e8c2000342570..62c7c092b1b5d594b9d47f392526cdabb731d94e 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -113,14 +113,14 @@ xgboost = "1.4.2"
 
 [[package]]
 name = "aliby-post"
-version = "0.1.4"
+version = "0.1.5"
 description = "Post-processing tools for aliby pipeline."
 category = "main"
 optional = false
 python-versions = ">=3.7.1,<3.11"
 
 [package.dependencies]
-aliby-agora = ">=0.2.7,<0.3.0"
+aliby-agora = ">=0.2.8,<0.3.0"
 catch22 = ">=0.2.0,<0.3.0"
 leidenalg = ">=0.8.8,<0.9.0"
 more-itertools = ">=8.12.0,<9.0.0"
@@ -1917,7 +1917,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-
 [metadata]
 lock-version = "1.1"
 python-versions = ">=3.7.1,<3.11"
-content-hash = "b6cf9e778262fb9be9713d3bd9f4f3028784c01c0d5c99ff64c3fc59cd38c9d8"
+content-hash = "b9c999b005d53a0efb0a37f1581fe3eac5702ca8ae43fdf11fc669a7413b7a8c"
 
 [metadata.files]
 absl-py = [
@@ -2023,8 +2023,8 @@ aliby-baby = [
     {file = "aliby_baby-0.1.2-py3-none-any.whl", hash = "sha256:f8f11b82db89a74ad8cc48059370af889f246a83d4cbc45ce75d9475a15605f7"},
 ]
 aliby-post = [
-    {file = "aliby-post-0.1.4.tar.gz", hash = "sha256:9551a764ebeba126414e8a564a36a58c0265eb5ef49df42c059ed1be80c72217"},
-    {file = "aliby_post-0.1.4-py3-none-any.whl", hash = "sha256:b5537eb53c2e0758888e65285a399832562f8f2e6d8a71f144c147a1d6e42dbc"},
+    {file = "aliby-post-0.1.5.tar.gz", hash = "sha256:f4724ff026414dc6c6c50621a303dafba42d5e85f7ee07d57db85319499027e9"},
+    {file = "aliby_post-0.1.5-py3-none-any.whl", hash = "sha256:fb2f281b481624c2cfe262d63e21199aefd397e3deedcf8df64b26932761271d"},
 ]
 appdirs = [
     {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"},
diff --git a/pyproject.toml b/pyproject.toml
index 92f2043e38d0a751ea90547af059ba38e53f129b..2c4f2dbab02b5193aa36572cccec42c85831bd10 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -31,7 +31,7 @@ tensorflow = ">=1.15,<=2.3"
 aliby-agora = "^0.2.4"
 aliby-baby = "^0.1.2"
 omni-gaussian = "^0.1.1"
-aliby-post = "^0.1.4"
+aliby-post = "^0.1.5"
 
 
 [tool.poetry.dev-dependencies]