added json null check