fix cdf function