Implemented pause and resume.