fixed broken collect, distribute functions