do not infinite loop on random layouts anymore