implemented pause feature