add pause/resume functionality