updates to work with couchdb