Make dbtype a local variable