bug fix for hydraulic head calculation