add pause and resume implementation