Fixing bug due a json call