adding request animation frame