Fixed a BUG when Hierarchy is Nan