Adding layout handling