add layout debug code