updated how it deals with json