added catch for invalid json