modify that use PouchDB instead of array.