fix problem of db creation/destruction, update pouchdb