only update at one specific moment in main function