added safe json version