Added auto update function