Improved wait method