correct way to handle array of deferred