add pause and resume method