Added a pause function