updated class for websockets