updated code to work with HEAD in geany