Implemented pause function.