fix layout nil issue