added update function