I am trying to implement the ability to manually terminate my websocket thread however I think I am running into the issue that the websocket reconnects due to my \'on_close