fix bug of not confirming connection