added database close.