fix zero size bug