made db into a def var because defn should be a top level form