fixed update function to do patch request