Step counter plugin gives error when the stop() method called after first time

Hello all
I have an issue in doing a step counter in ionic v3.x.
this is the code

import { Stepcounter } from '@ionic-native/stepcounter';

constructor(private stepcounter: Stepcounter){
 stepcounter.deviceCanCountSteps().then((res: any) => {
      if (res == false) {
        let alert = this.alertCtrl.create({
          title: 'Alert',
          subTitle: 'Oops!! Your device is not able to count your steps !!',
          buttons: ['OK']
        });
        alert.present();
      }
    }).catch((err) => this.failure(err))

}

startPedometer() {

    if (this.buttonIcon === 'md-walk') {
      this.buttonIcon = "md-man";
      this.startbuttonDisabled = false
      this.stopbuttonDisabled = true
      let startOffset = 0
      this.stepcounter.start(startOffset).then((res: any) => {
        this.success("Started : " + res)
      }).catch((err) => this.failure(err))
    }
    else if (this.buttonIcon === 'md-man') {
      this.buttonIcon = "md-walk";
      this.stopbuttonDisabled = false
      this.startbuttonDisabled = true
      this.stepcounter.stop().then((res: any) => {
        this.count = res
      }).catch((err) => this.failure(err))
    }
  }

ionViewDidEnter(){
    this.stepcounter.getStepCount().then((res:any)=>{
      console.log("---------counts-----------"+JSON.stringify(res));
      this.count = res
    })
  }

the following error is displayed after I press the the stop button second time.

Hi I am trying to use this same plugin…my requirement is to get the history object once my application starts and after every refresh of the app I want getTodaysSteps()…like total steps till now for a day since the application starts…my problem is with a mobile restart the app stops working (do not give any error ) and keeps giving previous data which was there before the restart… any help will be great