fixed pausing bug