updating path function