add a function to restart animation only if not already playing