Fixed the HEAD bug