add error message when invalid json is found