Fix isTop bug