bug fix for UDP connection thread