fixed close on multiple connection bug