fix load from state for js version.