give proper error for bad json