return 0 when distribute fails