fix close db