added threshold and seperate tcp connecting button