element update code