Fixed double update bug