added Pausing functionality