changed server side to work with jwebsockets