Handled pause and resume in sample application