add db wrapper to avoid open multitimes"