   (seq (select users (fields :id)(where {:email email}))))
 
 (defn update-token [id token]
-  (if-not (seq (select users (fields :id)(where {:email email :access_token token})))
+  (if-not (seq (select users (fields :id)(where {:access_token token})))
     (update users (set-fields {:access_token token})(where {:id id}))
     )
   (id)

  (:require [clj-oauth2.client :as oauth2])
  (:require [ppl.auth :as ppl_auth])
  ;(:require [korma.db :refer [select]])
  (:use [korma.core :only [select where fields, insert, values]])
  ;(:require [ppl.models :refer [users]])
  (:use [ppl.models :only [users]])
  ;(:require [korma.db] 

           (let [guser (ppl_auth/github-user token)]
             ;new user? create and login
             ;
            (let [current-user (check-user (get guser "email"))]
            (ppl_auth/login-user (if current-user
              (update-token current-user token)
              (insert users (values (create-user guser token)))
            )))))
         (redirect "/home")

           ;login said user
