Adds pausing functionality