added a check to see if json body is null