fix head lib function