Fixed socket timeout bug