updating custom fields code