                    clear-replay-sessions
                    show-ankha
                    show-ankha1
-                   next-page]}]
-     (comment log (str "map="(mapv
-                                      (fn [x]
-                                        {
-                                        :ui      (-> app :ui)
-                                        :data    x
-                                        }
-                                        )
-                                      (-> app :data :sessions))))
+                   next-page
+                   previous-page]}]
+     (let [
+           dfg           (- (* (+ (-> app :ui :current-page) 1) page-length) 1)
+           session-count (-> app :data :sessions-count)
+           ]
 
      (dom/div nil
               (dom/h2 nil "Playback web sessions")
               (dom/div nil (str (* (-> app :ui :current-page) page-length) "-"
-                                (- (* (+ (-> app :ui :current-page) 1) page-length) 1)
+                                  (if (< dfg (-> app :data :sessions-count))
+                                    dfg
+                                    (-> app :data :sessions-count)
+                                 )
                                 " of "
-                                (-> app :data :sessions-count)))
-              (dom/button #js {:onClick (fn [e]
-                                          (put! next-page
-                                                      true)
-                                          )} "Next")
-
+                                session-count))
+              (if (> dfg page-length)
+                (dom/button #js {:onClick (fn [e]
+                                            (put! previous-page
+                                                  true)
+                                            )} "previous"))
+              (if (< dfg session-count)
+                (dom/button #js {:onClick (fn [e]
+                                            (put! next-page
+                                                  true)
+                                            )} "Next"))
 
               (apply dom/ul nil
                      (om/build-all  playback-session-button-component

                                                      true))} "Ankha1")


              ))))

                   :clear-replay-sessions    (chan)
                   :show-ankha               (chan)
                   :next-page                (chan)
                   :previous-page            (chan)
                })

    om/IWillMount
