implemented pausing