implemented web socket communication