add a stop animation function