correctly calculate modal heights