Fix couldn't calculate correct fequency