Added five second delay in front of run-wait code. This works around a race condition.