Added a pausing function