making a JSON access safer