fix multiple connection bug