Fixed stage update--need to update by stage ID to avoid untrusted code error