added websocket code to frontend