add pause function.