Added a pause functionality.