added dbname as parameter to make tf plot fn