pause function implemented