callback for distribute