fix layout parsing