Fixed pause/resume bug