Added a custom catch for a wait.

Script now sometimes completes properly.