Fixed a bug if the fetch returns no records