better update functionality