Added code to close the database connection.