Make sure to reset internal state when filesystem is unmounted externally. Remove beforeUnmount which by definition cannot be made to work with this.