Added the wait method