logic for pause