Animation pausing and resuming functionality added