fxing mathematical failure