fix floating point exception