fixed isnan error