Added pause/resume functionality