refined the dgraph distribute and apply process