Added support for "wait" option when using "run"