close connections and delete global db.connect