fix height calculations