Fixed undefined variable db_type