use main script connect_db() rather than maintaining separate cached handle