fix HEAD bug