Fixing flash in layout