Update adjustheight function