fix the HEAD support bug