Fix connection close issue in broker