improved update code.
improved update code.

dataloop/dalmatiner-frontend,dalmatinerdb/dalmatiner-frontend,dataloop/dalmatiner-frontend,dataloop/dalmatiner-frontend,dalmatinerdb/dalmatiner-frontend,dalmatinerdb/dalmatiner-frontend