use request animation frame