handle js and json