fix height calculation