close database connection when done