use deferred to trigger done