Wait for finished processes