use safer json methods