fixed the floating point exception