wait per layer, otherwise will wait forever