Added optimization to path update