using clojure atoms to implement thread safe instance variables