Fixed websocket example logic when freeing the message