Fix animation bug in Firefox