The wait has no effect in that code, and Ive tried it and it doesnt crash, maybe something else is crashing in your script? Or are you not using the current version?