before layout and sub bugs