finish collect data code