update function should be working