fix a bug of getInheritDirection