add timeout and valueAsResult support