replace deprecated stop() method