Close connection when finished