Updated update code