fix prepare-ws