Agent: try and close connection under all circumstances