Fixed threads exit in the client side