Add pause and resume functionality