safely reset dbs upon exception