handling zero case