avoid useless initializations in layout preview mode