fixing error in calcHeight