updated db lib for module usage