fix layout crash