How can I break this loop when the client disconnects? - tRPC