add functions for update both for DM and TR