made the state maching controlling the websocket much cleverer. rearranged some log output in the controller