For update function.