added pausing support