add pause and resume