adapt to couchdb
and now it works