more reliable detection of layout completion