fix the problem that it could raise exception if mock data is imperfect