layout wait-for-completion trick