wrap json parse in try catch