dealing with invalid json data from browser/file