WaitTask: Added optional timeout