modify berkeleydb leads to mem leak errors