add wait condition