add stopAnimation function