changes so it will work with other party's js serialization (like stream reading etc.)