Implemented pause function