fix bug in pause/resume etc