Update function is working correctly