add collect and update function