This script error is most likely caused by having one or more undefined variables in waitUntil expression.