fix layout rendering problem