close connection methode