added n=0 check