semi-working update functionality