Fixing deprecated JSON call