fix minor bug on calculating the sigma