fix layout planning