handle returning `undefined` from a deferred function