Fixed manual trigger order.

When the state was set before the "startAnimating" function was called, the "stopAnimating" function could be called before the state was completely set. In that case, the animation would run forever.