if (options && options.onEnd && typeof options.onEnd === 'function') {
      this.onEnd = options.onEnd
    }