switching rAF method