Tweak js to not define animate twice