fix rx thread exit condition