nicer db closing