update layout and some other things.