   (edit-m message id)
   )
 
+(defn session-alive? []
+  (nil? (:timer @state)))
 
-(defn send-remaining []
-  (if (nil? @message-id)
+
+
+(defn send-remaining [byline]
+  (if (nil? (:message-id @state))
     (->> (send-m (str "남은 시간은 " (remaining-time) "초"))
          :result
          :message_id
-         (reset! message-id))
-    (edit-message @message-id (str "남은 시간은 " (remaining-time) "/" (ms->sec (base-time)) "초"))))
+         (swap! state assoc :message-id))
+    (edit-message (:message-id @state) (str "남은 시간은 " (remaining-time) "/" (ms->sec (base-time)) "초 by " byline))))
 
 
 
 (defn goto-x [key]
-  (let [state (key states)]
-    (send-m ((:text state)))
-    (reset! in-state key)
-    (reset! started (System/currentTimeMillis))
-    (reset! message-id nil)
-    (when-not (nil? @interval) (future-cancel @interval))
-    (reset! interval (set-interval #(send-remaining) (secs 10)))
+  (let [mode (key modes)]
+    (send-m ((:text mode)))
+    (swap! state assoc :mode key)
+    (swap! state assoc :started (System/currentTimeMillis))
+    (swap! state assoc :message-id nil)
+    (when-not (nil? (:interval @state)) (future-cancel (:interval @state)))
+    (swap! state assoc :interval (set-interval #(send-remaining "interval") (secs 10)))
     (when (= key :relax)
       (swap! counted inc))
-    (set-timeout #(goto-x (:next state)) (:during state))))
+    (set-timeout #(goto-x (:next mode)) (:during mode))))
 
 
 ;;;; Handlers
 (defn timer-start []
-  (if (nil? @timer)
+  (if (session-alive?)
     (goto-x :pomodoro)
     (send-m "이미 세션이 진행중입니다")))
 
 (defn check-remaining []
-  (if-not (nil? @timer)
-    (send-remaining)
+  (if-not (session-alive?)
+    (send-remaining "manual")
     (send-m "타이머가 돌고 있지 않음")))
 
 (defn cancel-timer []
-  (if-not (nil? @timer)
+  (if-not (session-alive?)
     (do
-      (future-cancel @timer)
-      (future-cancel @interval)
-      (reset! timer nil)
-      (send-m (str @in-state " 취소되었습니다")))
+      (future-cancel (:timer @state))
+      (future-cancel (:interval @state))
+      (swap! state assoc :timer nil)
+      (send-m (str (:mode @state) " 취소되었습니다")))
     (send-m "진행중인 태스크가 없습니다")))
 
 (defn count-counted []



(defn elapsed-time []
  (- (System/currentTimeMillis) @started))

(defn base-time []
  (:during (@in-state states)))

(defn ms->sec [ms]
  (quot ms 1000))

  (future (while true (do (Thread/sleep ms) (callback)))))

(defn set-timeout [callback ms]
  (swap! state assoc :timer (future (do (Thread/sleep ms)
                                        (swap! state assoc :timer nil)
                                        (callback)))))


(defn send-m
  ([message] (telegram/send-text (config/get :token) (config/get :chat-id) message))
