close db if normally shutdown