close connection manualy on error