fix minimum variance==0 problem