check if variances are 0 before dividing