code cleanup + bug fix

fixed error message about extension when first clicking on databases if
extension is set