fixed undefined in RAF ticks