fix recursive layout