fix errors on js sdk