replace setTimeout with rAF