Close connexion on error