add pause and logging