Add set frequency function