fix bugs in libs
rewrite pouchtovar