implemented safe json parse