Added a dynamic update function