fixed numerical precision issue