add functionality for wss (incomplete)