add requestAnimFrame funtionality