Fixed a bug when there are no cases