close database connections when done