collect function done.