Fix animationFrameHandler bug (#147)