update layout, fix crash