Moved updating to the end