Bug fixing.

waitHandle was undefined. Added it in the javascript.