added update function to server