fixed possible float overflow