Some modifications needed for pause function