partially fix db handler