diff --git a/src/Handler/Utils/Table/Pagination.hs b/src/Handler/Utils/Table/Pagination.hs
index 81ca65bd4..ce39f6300 100644
--- a/src/Handler/Utils/Table/Pagination.hs
+++ b/src/Handler/Utils/Table/Pagination.hs
@@ -727,6 +727,7 @@ dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> db
isSortable = isJust sortableKey
isSorted = (`elem` directions)
attrs = sortableContent ^. cellAttrs
+ piSorting' = [ sSet | sSet <- fromMaybe [] piSorting, Just (sortKey sSet) /= sortableKey ]
return $(widgetFile "table/cell/header")
columnCount :: Int64
diff --git a/templates/table/cell/header.hamlet b/templates/table/cell/header.hamlet
index 5322aef4d..408dc4561 100644
--- a/templates/table/cell/header.hamlet
+++ b/templates/table/cell/header.hamlet
@@ -2,10 +2,10 @@
$maybe flag <- sortableKey
$case directions
$of [SortAsc]
-
+
^{widget}
$of _
-
+
^{widget}
$nothing
^{widget}