add automatic update function