fixed math error