Changing Sin frequency smoothly in shader

In my vertex shader I am using a sin function to offset vertices. But as I change the frequency of my sin function I notice some "flickering". I guess that this comes from the way that the phase is not synchronised anymore.

float s = sin(frequency * _Time);

Is there a way to avoid those flickering effect while changing the frequency ?