fix close connection