          [button "Sign-in" "button" my-data focus ]]]])))
 
 (defn set-page! [currnt-page]
-  (if (nil? (get-value! :user))(set-key-value :page-location
-                                              [login])
-      (set-key-value :page-location
-                     currnt-page)))
+  (set-key-value :page-location
+                 currnt-page))
 
 (defn is-authenticated? []
   (not (nil? (get-value! :user))))

  (set-page! (get-value! :page-location)))

(defroute documents-list "/documents" []
  (js/console.log (get-value! :user))
  (if (is-authenticated?)(let [onres (fn [json]
                                       (let [dt (getdata json)]
                                         (set-key-value :documents dt)
                                         (set-key-value :total-pages (get-total-rec-no dt))
                                         (set-key-value :page-location  [render-documents (get-new-page-data (get-value! :documents)
                                                                                                             (get-value! :current-page))])))]
                           (http-get "http://localhost:8193/documents/all" onres))
      (set-key-value :page-location [login])))


(defroute documents-path "/documents/add" []

           goog.json.Serializer
           goog.date.Date))

(defonce storage (r/atom {:documents {}
                          :current-page 1
                          :total-pages 1
                          :page-location nil
                          :user nil}))


(defn set-key-value [k v]
