Before applying new layout