add pause functionality