solving pausing/resuming issue