fixed a bug in the mse calculation