fix headroom code