             [cheshire.core :refer :all]))
 
 (defn parse-int [string]
-  (read-string (re-find #"\d+" string))
+  (cond
+    (number? string) string
+    (nil? string) 0
+    :else (read-string (re-find #"\d+" string))
+    )
   )
 
 (defn parse-message [string]



(defn make-game [payload gid]
  {gid {:timestamp (:timestamp payload)
        :currentplayer (first (:players payload))
        :currentthrows []
        :playerorder (:players payload)

  (ws/start response-handler)
  (println "Websocket up")
  (reset! world-atom (load-backup))
  (loop [ line (read-line)]
    (let [message (parse-message line)]
      (if (valid? @world-atom message)
        (do (reset! world-atom (update-world @world-atom message)) (recur (read-line)))
        (recur (read-line))
        )
      )))