Fix sourcing in update function