Fix close connection