make pause & resume work correctly