A patient arrives in rapid atrial fibrillation with a rate of 160 bpm and is hemodynamically unstable.What is the most appropriate immediate intervention?