adds in viewport check to stop animation when off screen