fixed the frequency bug