make a function of collection