This should fix the pouchdb bug of replicate is undefined on instance