convert dbeem to function for parameterizing output db name