Add function to auto update