before change layout