changed input to update function