Update the right element while publishing a resource

Change-Id: I2a3e016a71822d6d5fecd592fab9ece061cad20e