        tabs))))
 
 (cl-defun mesh:find-next-session (current-session sessions)
-  (cl-letf* ((current-session-pos (cl-position-if
-                                   (lambda (s)
-                                     (cl-equalp (glof:get current-session :name)
-                                                (glof:get s :name)))
-                                   sessions)))
-    (pcase (1- (seq-length sessions))
+  (cl-letf* ((current-session-pos (seq-position
+                                   sessions
+                                   current-session
+                                   (lambda (a b)
+                                     (cl-equalp (glof:get a :name)
+                                                (glof:get b :name)))))
+             ;; (current-session-pos (cl-position-if
+             ;;                       (lambda (s)
+             ;;                         (cl-equalp (glof:get current-session :name)
+             ;;                                    (glof:get s :name)))
+             ;;                       sessions))
+             )
+    (pcase (if current-session-pos
+               (1- (seq-length sessions))
+             0)
       (0 nil)
       ((pred (eq current-session-pos))
        (mesh:first sessions))

      (_ nil))))

(cl-defun mesh:find-prev-session (current-session sessions)
  (cl-letf* ((current-session-pos (cl-position-if
                                   (lambda (s)
                                     (cl-equalp (glof:get current-session :name)
                                                (glof:get s :name)))
                                   sessions)))
    (pcase (seq-length sessions)
      (1 nil)
      ((guard (zerop current-session-pos))

             (mix-index (seq-min indices))
             (current-index (glof:get current-pane :index))
             (next-index (mesh:find-next-index current-index
                                            max-index
                                            indices)))
    (pcase (seq-length panes)
      (1 nil)
      (_ 
