replace the path with Spath variable