parsing json instead of comparing string