            command :command} incoming-message]
            (println "Received message from" nick "to" target ":" text "(" host command ")")
            (println incoming-message)
-           (if (message-for-me? @bot-nick incoming-message)
+           (if (message-for-me? @dyncfg/bot-nick incoming-message)
                (irc/reply connection (create-reply incoming-message)
                                      (prepare-reply-text incoming-message nick text)))))
 
 (defn send-message
     [recipients target message-text]
     (let [message {:target target :command "PRIVMSG"}]
-        (irc/reply @connection message (str recipients " " message-text))))
+        (irc/reply @dyncfg/connection message (str recipients " " message-text))))
 
 (defn start-irc-bot
     [configuration]

        incoming-message
        (assoc incoming-message :target (:nick incoming-message))))

(defn prepare-reply-text
    [incomming-message nick input-text]
    (let [in-channel? (message-to-channel? incomming-message)
          input       (if in-channel?
                          (subs input-text (count @bot-nick))
                          input-text)
          prefix      (if in-channel? (str nick ": "))]
        (str prefix "?")))

(defn on-incoming-message
    [connection incoming-message]

        (let [conn (irc/connect server port nick
                                :callbacks {:privmsg on-incoming-message})]
            (println "Connected, joining to channel" channel)
            (reset! dyncfg/connection conn)
            (reset! dyncfg/bot-nick nick)
            (irc/join @dyncfg/connection channel)
            (println "Connected..."))))

