Fix condition in unmounting