added function of 'pause' and 'resume'