oops, fix defer dbclose bug