Correctly restart css animation