fixed isRoot bug