fixed possible floating point exception